var form1 = {
    type: "form",
    name: "form1",
    title: "赠品领用",
    "buttons": ["保存", "关闭"],
    items: [
        {
            type:"sDate",      
            title:"单据日期",
		        "allowBlank" : false, 
		        dataIndex:'dataset.financeWastebookVo.inOutDate'
        },
        {
        	type:"textArea",			
        	title:"备注",
        	dataIndex:'dataset.financeWastebookVo.remark',
        	height:80
        },
        {
        	type:"numInput",
        	title:"金额",
        	dataIndex:'dataset.financeWastebookVo.money'
        },
        {
        	type:"input",
        	title:"经办人",
        	dataIndex:'dataset.financeWastebookVo.remark'
        }
    ],
    layoutConfig: {
        columns: 3
    },
    layout: [
         {items:[{'name':'单据日期'},{'name':'金额'},{'name':'经办人'}]},
         {items:[{'name':'备注',colspan:3}]}
    ]

};

var obj_frame;
var page1 = new Sail.page({
    id: "page1",
    haveNavi: false,
    frames: {
        autoLoad: true,
        getUrlParameter: ['id'],
        getURL: "../../inacount.do?method=edit",
        postURL: "../../inacount.do?method=save",
        bindDataFirst : false,
        businessData: {
						"dataset": { 
							"financeWastebookVo": {
											"id":"",      //设备主键
											"shopId":"FF85E8FB01704DA0AFC9825D9BA6A832",
											"inoutTypeId":"InoutType_3",//赠品领用
											"inAccountTypeId":"9F9B5DFDBF5B4C4588AD5900445C5302",//收入
											"accountTypeId":"77DBE19F4FF742F39C27BA8AD2070E7C",//政策帐号
											"auto":"0",
											"rollbackFlag":"0",
											"sysFlag":"1",			// 系统标志位        
											"creatorId":"",			// 创建人主键      
											"creatorName":"",		// 创建人名称    
											"createTime":"",		// 创建时间       
											"lastModifierId":"",	// 修改人主键 
											"lastModifierName":"",	// 修改人名
											"lastModifiedTime":""   // 修改时间 
			    			}
			     }
        },
        items: [form1],
        bindEvent2Items: function() {
            obj_frame = this;
            var form1 = $('form1');
            form1.addButtonHandler('保存', function() {
                this.saveBusiness('close');
            },
            this);

        }
    },
  afterRun:function(){
		setDefaultValue();

              
  }    
});

function setDefaultValue(){
	if (page1.isAdd()){
		$('单据日期').setValue(getCurrentDay());
		
		$('金额').setValue("0");
	}
}

page1.run();

